package com.tuozixuan.demo;

import reactor.core.publisher.Flux;

import java.awt.event.ItemEvent;
import java.util.function.Consumer;

public class BaseSubscribeDemo3 {

    public static void main(String[] args) {
        Flux.just("java", "python", "golang")
                .doOnNext(item -> System.out.println("Hello " + item + "!"))
                .doOnComplete(() -> System.out.println("Completed"))
                .take(2) // take()运算符将限制发送数据的数量
                .subscribe();

    }
}
